package com.qiuzhiyi.adapter;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.li.utils.TransformUtil;
import com.qiuzhiyi.R;
import com.qiuzhiyi.item.MsgListItem;

/**
 * Author: Li
 * Date: 2018/1/8 0008
 * Description:
 */

public class MsgListAdapter extends BaseQuickAdapter<MsgListItem,BaseViewHolder> {
    public MsgListAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, MsgListItem item) {
        ImageView imageView=helper.getView(R.id.img);
        Glide.with(mContext).load(item.getNewsRemark()).error(R.mipmap.icon).into(imageView);
        helper.setText(R.id.txt_title,item.getNewsTitle());
        helper.setText(R.id.txt_time, TransformUtil.timeFormat(item.getUpdateTime(),"yyyy-MM-dd"));
        helper.setText(R.id.txt_content,item.getNewsAuthor());
    }
}
